package com.auroramanito.uaa.config;

import cn.leancloud.core.AVOSCloud;
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Configuration;

import javax.annotation.PostConstruct;

@RequiredArgsConstructor
@Configuration
public class LeanCloudConfig {

    private final AppProperties appProperties;

    /**
     *    @PostConstruct是Java自带的注解，在方法上加该注解会在项目启动的时候执行该方法，也可以理解为在spring容器初始化的时候执行该方法。
     * */
    @PostConstruct
    public void initialize(){
        AVOSCloud.initialize(appProperties.getLeanCloud().getAppId(),appProperties.getLeanCloud().getAppKey());
    }
}
